<?php

class Mail
{
    public static function sendPlain($email, $name, $text)
    {
        require_once('./library/mail/class.phpmailer.php');

        $mail = new PHPMailer(true); 
        $mail->IsSendmail(); 

        try 
        {         
            $mail->AddAddress($email, $name);
            $mail->CharSet = 'utf-8';
            $mail->SetFrom('biuro@zabij.pl', 'zabij.pl');
            $mail->Subject = 'Dziękujemy za rejestracje w naszym portalu.';
            $mail->AltBody = 'Tekst widoczny tylko w przeglądarkach HTML'; 
            $mail->MsgHTML($text);//file_get_contents('contents.html')
        
            $mail->Send();           
        } catch (phpmailerException $e) {
            echo $e->errorMessage(); //Pretty error messages from PHPMailer
        } catch (Exception $e) {
            echo $e->getMessage(); //Boring error messages from anything else!
        }
       
    }
    
    public static function sendHTML($email, $file) 
    {
        
    }
}

?>
